package com.neudu.glsb.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 员工考勤信息
 * @TableName employee_attendance
 */
@TableName(value ="employee_attendance")
@Data
public class EmployeeAttendance implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 员工 ID
     */
    private Integer employeeId;

    /**
     * 考勤日期
     */
  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date attendanceDate;

    /**
     * 是否签到
     */
    private Integer isSigned;

    /**
     * 签到时间
     */
   @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date signInTime;

    /**
     * 是否迟到（0：否，1：是）
     */
    private Integer isLate;
    private String employeeName;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EmployeeAttendance other = (EmployeeAttendance) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getEmployeeId() == null ? other.getEmployeeId() == null : this.getEmployeeId().equals(other.getEmployeeId()))
                && (this.getAttendanceDate() == null ? other.getAttendanceDate() == null : this.getAttendanceDate().equals(other.getAttendanceDate()))
                && (this.getIsSigned() == null ? other.getIsSigned() == null : this.getIsSigned().equals(other.getIsSigned()))
                && (this.getSignInTime() == null ? other.getSignInTime() == null : this.getSignInTime().equals(other.getSignInTime()))
                && (this.getIsLate() == null ? other.getIsLate() == null : this.getIsLate().equals(other.getIsLate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getEmployeeId() == null) ? 0 : getEmployeeId().hashCode());
        result = prime * result + ((getAttendanceDate() == null) ? 0 : getAttendanceDate().hashCode());
        result = prime * result + ((getIsSigned() == null) ? 0 : getIsSigned().hashCode());
        result = prime * result + ((getSignInTime() == null) ? 0 : getSignInTime().hashCode());
        result = prime * result + ((getIsLate() == null) ? 0 : getIsLate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", employeeId=").append(employeeId);
        sb.append(", attendanceDate=").append(attendanceDate);
        sb.append(", isSigned=").append(isSigned);
        sb.append(", signInTime=").append(signInTime);
        sb.append(", isLate=").append(isLate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}